<?php defined('IN_IA') or exit('Access Denied');?><html ng-app="diandanbao" class="ng-scope">
<head>
    <style type="text/css">@charset "UTF-8";[ng\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\:form{display:block;}</style>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta content="telephone=no" name="format-detection">
    <link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon">
    <title>预订订单</title>
    <link data-turbolinks-track="true" href="<?php echo RES;?>/mobile/<?php  echo $this->cur_tpl?>/assets/diandanbao/weixin.css" media="all" rel="stylesheet">
    <style type="text/css">@media screen{.smnoscreen {display:none}} @media print{.smnoprint{display:none}}</style></head>
<body>
<div ng-view="" style="height: 100%;" class="ng-scope">
    <div class="ddb-nav-header ng-scope" common-header="">
        <div class="nav-left-item" onclick="location.href='<?php  echo $this->createMobileUrl('detail', array('id' => $storeid, 'mode' => 3), true)?>';"><i class="fa fa-angle-left"></i></div>
        <div class="header-title ng-binding">预订时间</div>
    </div>
    <div class="section ng-scope" style="margin-top: 45px;margin-bottom: 0px;">
        <div class="list-item  ddb-form-control custom-form-element ng-scope">
            <div class="ddb-form-label ng-binding">预订时间</div>
            <select class="ng-valid ng-scope ng-dirty ng-valid-parse ng-touched" onchange="changeDate(this);">
                <?php  if(is_array($dates)) { foreach($dates as $date) { ?>
                <option value="<?php  echo $date;?>" <?php  if($date==$select_date) { ?>selected="selected"<?php  } ?>><?php  echo $date;?></option>
                <?php  } } ?>
            </select>
        </div>
    </div>
    <div class="main-view ng-scope" id="time-points-index" style="padding-top: 1px;">
        <!--<div class="notification-section">-->
            <!--<div class="notice">-->
                <!--<i class="fa fa-volume-up red"></i>-->
                <!--<marquee behavior="alternate" scrollamount="1" scrolldelay="1">&nbsp;20分钟未到店，商家有权取消本次预订，请安排好您的时间&nbsp;</marquee>-->
            <!--</div>-->
        <!--</div>-->
        <div class="section"></div>
        <?php  if(is_array($tablezones)) { foreach($tablezones as $item) { ?>
        <div class="ng-scope">
        <div class="table-zone-item">
            <div class="name ng-binding"><?php  echo $item['title'];?></div>
            <div class="min_reservation_price ng-binding">￥<?php  echo $item['limit_price'];?>起订</div>
            <div class="time-points">
                <?php  if(is_array($list)) { foreach($list as $row) { ?>
                <?php  if($item['id'] == $row['tablezonesid']) { ?>
                <span class="button time-point ng-binding ng-scope <?php  if($cur_date == $select_date) { ?><?php  if($cur_time < $row['time']) { ?>border-red<?php  } ?><?php  } else { ?>border-red<?php  } ?>" <?php  if($cur_date == $select_date) { ?><?php  if($cur_time < $row['time']) { ?>onclick="selectTime(<?php  echo $row['id'];?>);"<?php  } ?><?php  } else { ?>onclick="selectTime(<?php  echo $row['id'];?>);"<?php  } ?>><?php  echo $row['time'];?></span>
                <?php  } ?>
                <?php  } } ?>
            </div>
            <div class="space-12"></div>
        </div>
        </div>
        <?php  } } ?>
		
		<!------------------------------------------------------------------------>
		<?php  if(is_array($list1)) { foreach($list1 as $item) { ?>
                    <?php  if($item['status']==0) { ?>
                    <?php  $status = 'idle';?>
                    <?php  $title = '空闲';?>
                    <?php  } else if($item['status']==1) { ?>
                    <?php  $status = 'opened';?>
                    <?php  $title = '已开台';?>
                    <?php  } else if($item['status']==2) { ?>
                    <?php  $status = 'ordered';?>
                    <?php  $title = '已下单';?>
                    <?php  } else if($item['status']==3) { ?>
                    <?php  $status = 'paid';?>
                    <?php  $title = '已支付';?>
                    <?php  } ?>
                    <div class="state-table" data-id="<?php  echo $item['id'];?>">
                        <a class="<?php  echo $status;?> round" href="<?php  echo $this->createWebUrl('tables', array('op' => 'detail', 'storeid' => $storeid, 'tablesid' => $item['id']))?>" data-remote="" title="点击查看订单详情">
                            
                        </a>
                        <div class="name overflow-ellipsis">
                            <span><a><?php  echo $item['title'];?></a></span>
                           
                        </div>
                    </div>
                    <?php  } } ?>
		<!------------------------------------------------------------------------>
    </div>
</div>
<input type="hidden" id="select_date" name="select_date" value="<?php  echo $select_date;?>">
<script type="text/javascript" src="../addons/smart_ct/template/js/2/jQuery.js"></script>
<script>
    function changeDate(obj) {
        var date = obj.value;
        var url = "<?php  echo $this->createMobileUrl('ReservationIndex', array('storeid' => $storeid), true)?>" + "&selectdate=" + date;
        window.location.href = url;
    }

    function selectTime(id) {
        var select_date = $("#select_date").val();
        var url = "<?php  echo $this->createMobileUrl('ReservationDetail', array('storeid' => $storeid), true)?>" + "&selectdate=" + select_date + "&timeid=" + id;
        window.location.href = url;
    }
</script>
</body>
</html>